package org.jeecg.common.modules.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.jeecg.common.modules.sys.entity.SysAccount;

import java.math.BigDecimal;

/**
 * @author guoyh
 * @ClassName SysAccountMapper
 * @Description
 * @since 2020/9/5 16:06
 **/
public interface SysAccountMapper extends BaseMapper<SysAccount> {

    /**
     * 变更账户余额
     * @param amount
     * @param id
     */
    @Update("update sys_account set balance = balance + #{amount} where id = #{id}")
    void changeBalance(@Param("amount")BigDecimal amount,@Param("id") Long id);
}
